#!/usr/bin/env node

var xm = require('../lib/xml-mapping.js')
	,util = require('util')
	,assert = require('assert');

[
	'<key>value</key>'
	,'<key attr="value1">value2</key>'
	,'<key><key1>value1</key1><key2>value2</key2></key>'
	,'<key><key>value1</key><key>value2</key></key>'
	,'<key><key><key>value2</key></key></key>'
	,'<key><![CDATA[value]]></key>'
	,'<key><!--value--></key>'
].forEach(function(xml) {
		var json = xm.tojson(xml);
		process.stdout.write(xml);
		process.stdout.write('\n');
		process.stdout.write(util.inspect(json, false, null, true));
		process.stdout.write('\n\n');
		assert.equal(xml, xm.toxml(json));
})


//,'<key>val<key>value2</key>ue1</key>'

